package me.zhengjie.pojo.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @author Long
 * @date 2021/6/29 16:33
 */
@Data
@TableName("sys_dept")
@ApiModel(value = "Dept", description = "部门表实体类")
public class Dept {

    @TableId(value = "dept_id",type = IdType.AUTO)
    @ApiModelProperty("主键Id")
    private Integer deptId;

    @ApiModelProperty("上级部门")
    private Long pid;

    @ApiModelProperty("子部门数目")
    private Integer subCount;

    @ApiModelProperty("名称")
    private String name;

    @ApiModelProperty("排序")
    private Integer deptSort;

    @ApiModelProperty("状态")
    private Boolean enabled;

    @ApiModelProperty("创建者")
    private String createBy;

    @ApiModelProperty("更新者")
    private String updateBy;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty("创建日期")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty("更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

}
